package com.PAT.practice02;

import java.util.HashSet;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/12/16/15:11
 * @Description:
 * @Target:
 */
public class 组合数的和 {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        String s  = in.nextLine();
        String[] s1 = s.split(" ");
        int[] arr = new int[s1.length];
        int index = 0;
        for (String s2 : s1) {
          arr[index++]=Integer.valueOf(s2);
        }

        HashSet set = new HashSet();
        int sum = 0;

        for (int i = 1; i < arr.length; i++) {
            for (int j = 1; j < arr.length; j++) {
                if (i!=j){
                    sum+=(arr[i]*10+arr[j]);
//                    set.add((arr[i]*10+arr[j]));
                }
            }
        }

//        set.forEach(System.out::println);
        System.out.println(sum);


    }

}
